#!/bin/bash

uninstall() {
    local name=$1
    pushd $name
    chmod 777 *
    ./uninstall.sh
    popd
}

unzipinstall() {
    local name=$1
    unzip $name.zip
    pushd $name
    chmod 777 *
    ./uninstall.sh
    popd
    rm -r $name
}

if [ `whoami` != "root" ]; then
    echo "需要以root用户执行"
    exit -1;
fi

echo "开始卸载相关的所有驱动和应用软件包..."
uninstall "310b"
uninstall "deb"
uninstall "tool"
uninstall "python"
unzipinstall "ES_D2V3GX_BMC_HardStatus_Ubuntu_V1.0"
uninstall "network-resize-boot"
